export default function(): void {
  const init = function(): void {
    setFontSize()
    bindEvent()
  }
  init()

  function bindEvent(): void {
    window.addEventListener('resize', setFontSize)
  }

  function setFontSize(): void {
    const oRoot: HTMLElement = document.documentElement
    const cWidth: number = oRoot.clientWidth
    const fontSize: string | number = oRoot.style.fontSize

    if (cWidth < 1600 && cWidth > 800) oRoot.style.fontSize = cWidth / 160 + 'px'
    else if (fontSize !== '62.5%' && cWidth > 800) oRoot.style.fontSize = '62.5%'
    else oRoot.style.fontSize = 800 / 160 + 'px'
  }
}
